import Vue from 'vue'
import App from './App.vue'
import service from '@/plugins/axios'
import API from './api/index';
import store from './store/index'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css';
const errorHandler = (error, vm)=>{
  console.error(vm);
  console.error(error);

}


Vue.directive('title', {
  inserted: function (el, binding) {
    document.title = el.dataset.title
  }
})

Vue.config.errorHandler = errorHandler;
Vue.prototype.$throw = (error)=> errorHandler(error,this);

Vue.use(ElementUI,{size:'large'});
Vue.config.productionTip = false

Vue.prototype.$store = store

Vue.prototype.$http = service


Vue.prototype.$api = API;




new Vue({
  render: h => h(App),
}).$mount('#app')
